/*
 * @lc app=leetcode.cn id=55 lang=java
 *
 * [55] 跳跃游戏
 */

// @lc code=start
class Solution {
    public boolean canJump(int[] nums) {
        if (nums == null)
            return false;

        int reachable = nums.length - 1;
        for (int i = nums.length - 2; i >= 0; i--)
        {
            if (nums[i] + i >= reachable) {
                reachable = i;
            }
        }

        return reachable == 0;

    }
}
// @lc code=end

